import {
  createRouter,
  createWebHashHistory
} from 'vue-router'

const routes = [{
    name: 'Error404',
    path: '/:error*',
    component: () => import('@/pages/error/404.vue'),
    meta: {
      isLogin: false
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login/index.vue'),
    meta: {
      isLogin: false
    },
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/pages/register/index.vue'),
    meta: {
      isLogin: false
    },
  },
  {
    path: '/findPassword',
    name: 'FindPassword',
    component: () => import('@/pages/password/index.vue'),
    meta: {
      isLogin: false
    },
  },
  {
    path: '/clause',
    name: 'Clause',
    component: () => import('@/pages/clause/index.vue'),
    meta: {
      isLogin: false
    },
  },
  {
    path: '/policy',
    name: 'Policy',
    component: () => import('@/pages/policy/index.vue'),
    meta: {
      isLogin: false
    },
  },
  {
    path: '/medicine/service_license',
    name: 'ServiceLicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/file_proof',
    name: 'FileProof',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/medicine/tel_license',
    name: 'Tellicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/business_license',
    name: 'BusinessLicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/',
    redirect: '/overview',
    component: () => import('@/pages/index/index.vue'),
    children: [{
        path: '/employee',
        name: 'Employee',
        component: () => import('@/pages/staff/employee.vue')
      },
      {
        path: '/authority',
        name: 'Authority',
        component: () => import('@/pages/staff/authority.vue')
      },
      {
        path: '/goods',
        name: 'Goods',
        component: () => import('@/pages/goods/index.vue')
      },
      {
        path: '/goods/edit/:id',
        name: 'GoodsEditId',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/goods/edit',
        name: 'GoodsEdit',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/goods/add',
        name: 'GoodsAdd',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/order',
        name: 'Order',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'list'
        }
      },
      {
        path: '/order/detail/:id',
        name: 'OrderDetail',
        component: () => import('@/pages/order/detail.vue'),
        meta: {
          ori: 'detail'
        }
      },
      {
        path: '/order/afterSale/detail/:id',
        name: 'OrderAfterSaleDetail',
        component: () => import('@/pages/order/after.vue')
      },
      {
        path: '/order/audit/:id',
        name: 'OrderAudit',
        component: () => import('@/pages/order/detail.vue'),
        meta: {
          ori: 'audit'
        }
      },
      {
        path: '/payment',
        name: 'Payment',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'pay'
        }
      },
      {
        path: '/deliver',
        name: 'Deliver',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'deliver'
        }
      },
      {
        path: '/afterSale',
        name: 'AfterSale',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'afterSale'
        }
      },
      {
        path: '/afterSale/detail/:id',
        name: 'AfterSaleDetail',
        component: () => import('@/pages/order/after.vue')
      },
      {
        path: '/userInfo',
        name: 'UserInfo',
        component: () => import('@/pages/user/index.vue')
      },
      {
        path: '/overview',
        name: 'Overview',
        component: () => import('@/pages/overview/index.vue')
      },
      {
        path: '/statistics',
        name: 'Statistics',
        component: () => import('@/pages/statistics/index.vue')
      },
      {
        path: '/member',
        name: 'Member',
        component: () => import('@/pages/member/index.vue')
      }
    ]

  }

]




export default createRouter({
  history: createWebHashHistory(),
  routes
})
